home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7877 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  530 b 

  1. From: mhcox@msn.com (Michael Cox)
  2. Subject: RE: Am I imagining auto_ptr?
  3. Date: 17 Feb 96 20:35:28 -0800
  4. References: <3124A4D5.FF@novell.com>
  5. Message-ID: <00001a81+0000a352@msn.com>
  6. Path: news.msn.com!msn.com
  7. Newsgroups: comp.lang.c++
  8. Organization: The Microsoft Network (msn.com)
  9.  
  10. auto_ptr is part of the STL.  It is a template class that i think is 
  11. defined in the <utility> header file.  Used something like:
  12.  
  13. class Foo;
  14.  
  15. aFunction()
  16. {
  17.     auto_ptr<Foo> pFoo = new Foo;
  18.  
  19.     ... use pFoo.  If exception occurs, pFoo will be deleted.
  20. }
  21.